import {Entity, PrimaryGeneratedColumn, Column, BaseEntity, CreateDateColumn} from "typeorm";

@Entity()
export class Goods extends BaseEntity{
    @PrimaryGeneratedColumn()
    id: number;

    @Column({type:"varchar",length:64,unique:true})
    gcode: string;

    @Column({type:"varchar",length:64})
    typeCode: string;

    
    @Column({type:"varchar",length:64})
    name: string;

    @Column('text')
    descp: string;
    @Column('text')
    imgUrl: string;

    @Column({unsigned:true,default:0})
    weight: number;
    @Column({type:'decimal',precision:20,scale:2})
    price: number;


    @CreateDateColumn()
    createtime: Date;

    @CreateDateColumn()
    updatetime: Date;

}